package com.ad_hccm.dao.TreatmentHistory;

import com.ad_hccm.domain.TreatmentHistory.OtherDiseaseTwo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * TODO 其他疾病治疗史Dao
 */
@Mapper
public interface OtherDiseaseTwoDao {
    @Insert("insert into other_disease_two value(#{id}, #{diseaseName}, #{diseaseCourse}, #{diseaseActivity}, #{treat}, #{medicineNameAndOtherMeasures})")
    public boolean save(OtherDiseaseTwo otherDiseaseTwo);

    @Update("update other_disease_two set diseaseCourse = #{diseaseCourse}, diseaseActivity = #{diseaseActivity}, treat = #{treat}, medicineNameAndOtherMeasures = #{medicineNameAndOtherMeasures} where id=#{id} and diseaseName = #{diseaseName}")
    public boolean update(OtherDiseaseTwo otherDiseaseTwo);

    @Select("select * from other_disease_two where id=#{id}")
    public List<OtherDiseaseTwo> getById(String id);

    @Select("select * from other_disease_two")
    public List<OtherDiseaseTwo> getAll();

    @Delete("delete from other_disease_two where id=#{id} and diseaseName = #{diseaseName}")
    public boolean delete(OtherDiseaseTwo otherDiseaseTwo);
}